package com.lemon.boot.controller;

import com.lemon.boot.service.INoticeUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.annotation.security.PermitAll;

/**
 * 公告用户中间表控制层
 *
 * @author Lemon
 * @since 2024-02-29
 */
@Log4j2
@Api(tags = "公告用户关联")
@RestController
@RequestMapping("noticeUser")
public class NoticeUserController {
    @Resource
    private INoticeUserService iNoticeUserService;

    /**
     * 标记已读
     *
     * @param noticeId
     * @return
     */
    @PermitAll
    @ApiOperation(value = "标记已读")
    @PutMapping("readByNoticeId")
    public void readByNoticeId(@RequestParam("noticeId") Long noticeId) {
        iNoticeUserService.readByNoticeId(noticeId);
    }
}